<?php
// +--------------------------------- 商品请求参数验证类 -------------------------------------
namespace app\validate;

use think\Validate;

class GoodsValidate extends Validate
{
    protected $rule = [
        'showType'  => 'require|in:index,type,search,store',
        'typeValue' => 'requireIf:showType,type,search,store',
        'page'      => 'number|gt:0',
        'size'      => 'number|gt:0'
    ];
    
    protected $message = [
        'showType.require' => '展示类型不能为空',
        'showType.in'      => '展示类型必须是index,type,search,store之一',
        'typeValue.requireIf' => '类型值不能为空',
        'page.number'      => '页码必须是数字',
        'page.gt'          => '页码必须大于0',
        'size.number'      => '每页条数必须是数字',
        'size.gt'          => '每页条数必须大于0'
    ];
}